#include "app_mqtt.h"
#include "log.h"
#include <unistd.h>
#include <stdio.h>

static  int  busi_callback (char *payload, int payloadlen) 
{
     log_info("接收到 mqtt 数据：%s",payload);
     return 0;
}
  
int main(int argc, char const *argv[])
{

    //1   创建mqtt对象
    int ret= app_mqtt_init();
    if (ret<0)
    {
        log_error("app_mqtt_init failed\n");
        return -1;
    }
    
    //2   注册业务回调函数 
   // app_mqtt_register_recv_callback(busi_callback);

    //3   发送数据 
    app_mqtt_send("atguigu",7);  

    //4   释放资源 
    sleep(10000);
    
    return 0;
}
